package cn.tedu.spring.life;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

@Component
public class Order {
    private String status;

    public Order() {
        System.out.println("1.实例化阶段[无参构造]");
    }

    @Value("等待买家付款")
    public void setStatus(String status) {
        this.status = status;
        System.out.println("2.属性赋值阶段[set方法]");
    }

    @PostConstruct
    public void init(){
        System.out.println("3.生命周期初始化方法");
    }

    @PreDestroy
    public  void destroy(){
        System.out.println("5.生命周期销毁方法");
    }
}
